package com.swing.gui.pages.loading;

import base.JPanelBase;
import base.PageAdapter;

import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * 初始化系统界面
 * 展示加载所有界面（进度条形式）
 *
 * @author Yuang, Gongming
 * @date 2022-01-27 9:46
 */
public class Initialize extends JPanel {
    private volatile static Initialize initialize;

    public JProgressBar process;
    public JLabel tips;

    private Initialize() {
        //  页面单例化
    }

    public static Initialize start() {
        if (initialize == null) {
            synchronized (Initialize.class) {
                if (initialize == null) {
                    initialize = new Initialize();
                    try {

                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(null, e, "程序错误", JOptionPane.ERROR_MESSAGE);
                        System.exit(0);
                    }
                }
            }
        }
        return initialize;
    }

    public static void main(String[] args) {
        Initialize.start();
    }
}
